<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="alert('hello js');">提交</button>
    <button onclick="abc()">确定</button>
</body>
<script>
    function abc(){
        let user=new Object();//定义对象,不像java
        //先要定义类,然后用类new对象
        user.id=123;
        user.name="张三";
        user.age=19;
        user.toString=function(){
            console.log(this.name);
        };
        user.toString();

        let st={//键值对
            id:123,
            name:"李四",
            age:20,
            print:function(){
                console.log(this.name);
            }
        };

        st.id=456;
        st.name="李四四";
        st.print();
    }
    
</script>
</html>